package com.aaa.controller;

import com.aaa.entity.User;
import com.aaa.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/system/user")
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("getByUsername/{username}")
    public User getByUsername(@PathVariable String username) {
        return userService.findByUsername(username);
    }

    @GetMapping("listUser")
    public List<User> getListUser(){
        return userService.getListUser();
    }
    @PostMapping("listAllUser")
    public List<User> getListAllUser(@RequestBody Map<String, Object> map){
        return userService.getListAllUser(map);
    }
}
